Has anyone got an example of a working piece of code using the addBaselines function?
I appear to smashing my head against a brick wall trying to get it to work.
I have written code that creates a new Baseline Set Definition, adds modules to it and then creates a Baseline Set. However the addBaselines function which comes next always returns !null, failing to add the module baselines to the set.
I have read previously that there may be a nuance with the skiplist index but have tried every which way of formatting this and it still does not work.
Any help would be greatly appreciated!
doorsdude - Wed Jul 01 06:41:34 EDT 2009 |
|
Re: addBaselines doorsdude - Wed Jul 01 07:01:00 EDT 2009
I decided to try and write an uber-basic version of my code just using a single module. Once again the addBaselines function passes an error and doesn't add the module to the set.
The code is attached. Note, it's not hugely pretty as I threw it together just now!
Paul
Attachments
attachment_14269204_addBaseline_Testing.dxl
|
|
Re: addBaselines doorsdude - Wed Jul 01 09:29:52 EDT 2009
Just noticed there's an error in the attached dxl above in that I've incorrectly stated 'addmodule' instead of 'addModule'.
However that's purely a typographical error in this case and is not my problem with this code.
|
|
Re: addBaselines doorsdude - Wed Jul 01 09:42:06 EDT 2009
I had a colleague try the code on a different system and he received a trigger error which I fixed by defining the ModName_ differently.
Once I'd done the correction he had exactly the same problem with only the addBaselines function failing.
Updated code is attached.
Attachments
attachment_14269288_addBaseline_Testing.dxl
|
|
Re: addBaselines doorsdude - Wed Jul 01 10:34:53 EDT 2009
Well I couldn't just let it rest for a bit and have now solved my own problem!
The issue is that I, probably rather naively, believed the manual.
The last sentence when explaining addBaselines states: 'It fails if the user does not a hold a lock on the Baseline Set Definition'.
WRONG! In fact it only works if the Baseline Set Definition is unlocked. By simply moving the unlock command line to before my addBaselines function it all seems to work now.
Moral of the story, don't take the DXL Reference Manual at face value. In fact, ironically enough, I came across this answer while carefully studying Example 2 of Baseline Sets in the manual and comparing its sequencing to my code. They got it right in the example, wrong in the text!
Sorry for spamming the board again but I thought people should know.
Cheers, Paul.
|
|
Re: addBaselines llandale - Wed Jul 01 13:27:38 EDT 2009 doorsdude - Wed Jul 01 10:34:53 EDT 2009
Well I couldn't just let it rest for a bit and have now solved my own problem!
The issue is that I, probably rather naively, believed the manual.
The last sentence when explaining addBaselines states: 'It fails if the user does not a hold a lock on the Baseline Set Definition'.
WRONG! In fact it only works if the Baseline Set Definition is unlocked. By simply moving the unlock command line to before my addBaselines function it all seems to work now.
Moral of the story, don't take the DXL Reference Manual at face value. In fact, ironically enough, I came across this answer while carefully studying Example 2 of Baseline Sets in the manual and comparing its sequencing to my code. They got it right in the example, wrong in the text!
Sorry for spamming the board again but I thought people should know.
Cheers, Paul.
We are glad we could help you with your issue.
|
|
Re: addBaselines SystemAdmin - Thu Nov 12 11:49:47 EST 2009 doorsdude - Wed Jul 01 10:34:53 EDT 2009
Well I couldn't just let it rest for a bit and have now solved my own problem!
The issue is that I, probably rather naively, believed the manual.
The last sentence when explaining addBaselines states: 'It fails if the user does not a hold a lock on the Baseline Set Definition'.
WRONG! In fact it only works if the Baseline Set Definition is unlocked. By simply moving the unlock command line to before my addBaselines function it all seems to work now.
Moral of the story, don't take the DXL Reference Manual at face value. In fact, ironically enough, I came across this answer while carefully studying Example 2 of Baseline Sets in the manual and comparing its sequencing to my code. They got it right in the example, wrong in the text!
Sorry for spamming the board again but I thought people should know.
Cheers, Paul.
Thanks for the post. I'd like to add something:
I was doing a similar bit of code and kept getting the error string "Baseline already exists in the Baseline Set" from addBaselines. The problem turned out to be that I wasn't using an integer for the key of the passed skip list. Once I change the key to an int, it worked. Says nothing about this in the manual, but I noticed both the poster and the example used integers.
|
|